﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace Nosc.Repository
{
    public class JsonRepository
    {
        public bool GetDeserializeServices(string json)
        {
            bool res = false;

            if (!String.IsNullOrEmpty(json))
            {
                try
                {
                    res = bool.Parse(json);
                }
                catch (Exception)
                {
                    
                    return false;
                }
            }

            return res;
        }

        public Dictionary<string, string> GetResponseDictionary(string response)
        {
            Dictionary<string, string> resx = JsonConvert.DeserializeObject<Dictionary<string, string>>(response);
            return resx;
        }
    }
}
